//
//  ZHShowSpline.m
//  Doctor
//
//  Created by liuzhishan on 15/12/22.
//  Copyright © 2015年 shanshan. All rights reserved.
//

#import "ZHShowSpline.h"


@implementation ZHShowSpline

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        [self addMyChildViews];
        
    }
    return self;
}

-(void)addMyChildViews
{
    self.imageViewUp = [[UIImageView alloc]init];
    self.imageViewUp.translatesAutoresizingMaskIntoConstraints = NO;
    [self addSubview:self.imageViewUp];
    
    [self addConstraint:[NSLayoutConstraint constraintWithItem:self.imageViewUp attribute:(NSLayoutAttributeLeft) relatedBy:(NSLayoutRelationEqual) toItem:self attribute:(NSLayoutAttributeLeft) multiplier:1.0 constant:30]];
    [self addConstraint:[NSLayoutConstraint constraintWithItem:self.imageViewUp attribute:(NSLayoutAttributeRight) relatedBy:(NSLayoutRelationEqual) toItem:self attribute:(NSLayoutAttributeRight) multiplier:1.0 constant:-30.0]];
    [self addConstraint:[NSLayoutConstraint constraintWithItem:self.imageViewUp attribute:(NSLayoutAttributeCenterY) relatedBy:(NSLayoutRelationEqual) toItem:self attribute:(NSLayoutAttributeCenterY) multiplier:0.5 constant:10]];
    
    
      [self addConstraint:[NSLayoutConstraint constraintWithItem:self.imageViewUp attribute:(NSLayoutAttributeHeight) relatedBy:(NSLayoutRelationEqual) toItem:self attribute:(NSLayoutAttributeHeight) multiplier:0.15 constant:0]];
 
    
   
    self.lableDown = [[UILabel alloc]init];
    self.lableDown.translatesAutoresizingMaskIntoConstraints = NO;
    
    [self addSubview:self.lableDown];
    
    [self addConstraint:[NSLayoutConstraint constraintWithItem:self.lableDown attribute:(NSLayoutAttributeLeft) relatedBy:(NSLayoutRelationEqual) toItem:self attribute:(NSLayoutAttributeLeft) multiplier:1.0 constant:5]];
    [self addConstraint:[NSLayoutConstraint constraintWithItem:self.lableDown attribute:(NSLayoutAttributeRight) relatedBy:(NSLayoutRelationEqual) toItem:self attribute:(NSLayoutAttributeRight) multiplier:1.0 constant:-5.0]];
     [self addConstraint:[NSLayoutConstraint constraintWithItem:self.lableDown attribute:(NSLayoutAttributeCenterY) relatedBy:(NSLayoutRelationEqual) toItem:self attribute:(NSLayoutAttributeCenterY) multiplier:1.5 constant:0]];
     [self addConstraint:[NSLayoutConstraint constraintWithItem:self.lableDown attribute:(NSLayoutAttributeHeight) relatedBy:(NSLayoutRelationEqual) toItem:self attribute:(NSLayoutAttributeHeight) multiplier:0.4 constant:0]];
    self.lableDown.textAlignment = NSTextAlignmentCenter;
    self.lableDown.textColor = [UIColor whiteColor];
    self.lableDown.font = [UIFont systemFontOfSize:14 * WIDPro - 2];

}

@end
